//
//  ViewController.m
//  MyAlertView
//
//  Created by zhouLiHuan on 2016/12/14.
//  Copyright © 2016年 zhouLiHuan. All rights reserved.
//

#import "ViewController.h"
#import "LHAlertView.h"

@interface ViewController ()<LHAlertViewDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
   
    UIButton *alertBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    alertBtn.frame = CGRectMake(50, 100, 100, 50);
    [alertBtn setTitle:@"点击" forState:UIControlStateNormal];
    alertBtn.backgroundColor = [UIColor grayColor];
    [alertBtn addTarget:self action:@selector(alertBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:alertBtn];
}

//点击按钮 出现弹框
- (void)alertBtnClick{
    LHAlertView *alertView = [[LHAlertView alloc] initWithFrame:[UIScreen mainScreen].bounds];
    alertView.delegate = self;
    NSArray *btnTitleArr = @[@"取消",@"确定"];
    [alertView setContentStr:@"出现弹框出出现" type:10 btnNum:2 btntitleArr:btnTitleArr];
    UIView *keywindow = [[UIApplication sharedApplication] keyWindow];
    [keywindow addSubview: alertView];
}

#pragma mark - 代理事件
- (void)clickBottomBtnWithView:(LHAlertView *)alterView andClickBtn:(UIButton *)clickBtn{

    if(clickBtn.tag == 100){
        NSLog(@"点击了取消按钮");
    }else{
        NSLog(@"点击了确定按钮");
    }
}

- (void)clickOtherPayMoneyWithView:(LHAlertView *)alterView andOtherPayMoneyBtn:(UIButton *)payMoney{

    NSLog(@"点击了其他按钮");
    
}



@end
